package sample.dubbo.refer;

import java.util.concurrent.CountDownLatch;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import sample.dubbo.export.ExportSample;

/**
 * Created on 2020/7/28
 */
public class ReferSample {

	public static void main(String[] args) throws InterruptedException {
		ApplicationConfig appConfig = new ApplicationConfig();
		appConfig.setName("refer-sample");
		RegistryConfig registryConfig = new RegistryConfig();
		registryConfig.setAddress("multicast://224.5.6.7:1234");

		ReferenceConfig referenceConfig = new ReferenceConfig();
		referenceConfig.setInterface(ExportSample.FooService.class);
		referenceConfig.setRegistry(registryConfig);
		referenceConfig.setApplication(appConfig);
		referenceConfig.get();
		new CountDownLatch(1).await();
	}
}
